home *** CD-ROM | disk | FTP | other *** search
/ ftp.qualcomm.com / 2014.06.ftp.qualcomm.com.tar / ftp.qualcomm.com / eudora / developers / emsapi / carbon_emsapi.sit.hqx / Macintosh API Support / rfc1847.h < prev    next >
Text File  |  2001-03-08  |  2KB  |  78 lines

  1. /* ======================================================================
  2.  
  3.     Functions to aid manipulation and parsing of MIME RFC1847 objects.
  4.  
  5.     Filename:            rfc1847.h
  6.     Last Edited:        March 7, 1997
  7.     Authors:            Scott Manjourides, Bob Fronabarger
  8.     Copyright:            1995, 1996 QUALCOMM Inc.
  9.     Technical support:    <emsapi-info@qualcomm.com>
  10. */
  11.  
  12. #ifndef RFC1847_H
  13. #define RFC1847_H
  14.  
  15. #include "buftype.h"
  16.  
  17.  
  18. /* Internally used values */
  19. typedef enum {
  20.     CSE_Start,
  21.     CSE_DoHeader,
  22.     CSE_DoBoundary,
  23.     CSE_DoPart,
  24.     CSE_DoOutput,
  25.     CSE_Done,
  26.     CSE_Fail
  27. } CreateStageEnum;
  28.  
  29. /* Internally used values */
  30. typedef enum {
  31.     PSE_Start,
  32.     PSE_SkipHeader,
  33.     PSE_ParseHeader,
  34.     PSE_SkipFirst,
  35.     PSE_PrePart,
  36.     PSE_OutPart,
  37.     PSE_Done,
  38.     PSE_Fail,
  39.     PSE_KeepUntil,
  40.     PSE_IgnoreUntil,
  41.     PSE_OutputUntil,
  42.     PSE_DoOutput
  43. } ParseStageEnum;
  44.  
  45. /* Create-state structure */
  46. typedef struct createState {
  47.     Boolean            initialized;
  48.     CreateStageEnum stage, next_stage, afterout_stage;
  49.     unsigned long    current_part;
  50.     BufTypeHandle    hTmpBuf, hOutputBuf;
  51.     Str255            boundaryStr;
  52. } createState, *createStatePtr, **createStateHandle;
  53.  
  54. /* Parse-state structure */
  55. typedef struct parseState {
  56.     Boolean            initialized;
  57.     ParseStageEnum    stage, next_stage, afterout_stage;
  58.     unsigned long    current_part, outputCount, afteroutSkip, leftSpanCount;
  59.     BufTypeHandle    hOutputBuf, hSearchBuf, hPrevBuf, hBoundaryBuf,
  60.                     hDblNewlineBuf, hNewlineBuf;
  61. } parseState, *parseStatePtr, **parseStateHandle;
  62.  
  63.  
  64. enum { RFC1847_FAIL, RFC1847_COMPLETED, RFC1847_BUFFERFULL };
  65.  
  66.  
  67. createStateHandle    NewCreateState();
  68. void                DeleteCreateState(createStateHandle pState);
  69. parseStateHandle    NewParseState();
  70. void                DeleteParseState(parseStateHandle pState);
  71.  
  72. long    RFC1847_Create(emsMIMEtypeH mimeHdl, BufTypeHandle pOutBuf,
  73.             BufTypeHandle pInPart1, BufTypeHandle pInPart2, createStateHandle pState);
  74. long    RFC1847_Parse(emsMIMEtypeH *mimeHdl, BufTypeHandle pOutPart1,
  75.             BufTypeHandle pOutPart2, BufTypeHandle pInBuf, parseStateHandle pState);
  76.  
  77. #endif /* RFC1847_H */
  78.